<?php
namespace App\Admin\User;

use Illuminate\Http\Request;
use App\Admin\Controller;
use Illuminate\Support\Facades\DB;

class install extends Controller
{
    //安装菜单
    public function menu(){
        $menuAdd = array(
            'title'=> '用户管理',
            'url'  => '/users',
            'target'  => '_self',
            'icon_class'  => '&amp;#xe60e;',
            'parent_id'  => 0,
            'sort'  => 0,
            'is_show'  => 1,
            'create_date'  => date('Y-m-d H:i:s'),
            'update_date'  => date('Y-m-d H:i:s'),
        );
        $menuId = DB::table('admin_menus')->insertGetId($menuAdd);
        $roleAdd = array(
            'menu_id' => $menuId,
            'action_ids' => json_encode(array()),
            'role_id' => 1
        );
        $roleId = DB::table('admin_permissions')->insertGetId($roleAdd);
        return $roleId;
    }
}
?>